private Polygon getBorderShape(int side) { Polygon shape = null; int[] widths = getWidths(); if (widths[side] != 0) { shape = new Polygon(new int[4], new int[4], 0); shape.addPoint(0, 0); shape.addPoint(-widths[(side + 3) % 4], -widths[side]); shape.addPoint(widths[(side + 1) % 4], -widths[side]); shape.addPoint(0, 0); } return shape; }